-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify updater #287
Merged
dxinteractive
merged 18 commits into
release/strict-swift
from
feature/simplify-updater
Mar 10, 2020
Merged
Simplify updater #287
dxinteractive
merged 18 commits into
release/strict-swift
from
feature/simplify-updater
Mar 10, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dxinteractive
force-pushed
the
feature/simplify-updater
branch
from
March 7, 2020 09:17
fb227df
to
5b923c1
Compare
Add createUpdater to allow people to compose their own updaters parcelData goes in, parcelData comes out
allanhortle
approved these changes
Mar 9, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #284, #285
dataparcels
parcel.update()
,parcel.modifyUp
andparcel.modifyDown
now always pass entire parcel data (not justvalue
) and expect either undefined or an object optionally containingvalue
andmeta
. Themeta
is shallowly merged into existing meta.parcel.modifyUp()
now passes changeRequest key on first param, not as second paramparcel.modifyUp((value, changeRequest) => {})
becomesparcel.modifyUp(({value, changeRequest}) => {})
asRaw
, as this is now the default behaviour of all updatersasNode
, because normal updaters cover all its uses nowparcelNode.setMeta
, becauseparcelNode.update
can now do the same thingparcel.spy()
andparcel.spyChange()
parcel.modifyDown(({value}) => { /* side effect */ })
andparcel.modifyUp(({changeRequest}) => { /* side effect */ })
instead, returning nothingcreateUpdater()
to allow people to create and compose their own updater functionsparcel.update()
now rebases correctly, passing new data through the updater, instead of retaining the result of the first execution as it did before V2 - make update() perform an "update" and not a "setData" #285react-dataparcels
useParcelState()
no longer allowsvalue
function to be used as an updater